package com.accenture.fd.dao;

import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import com.accenture.fd.entity.Tb00008;

@Mapper
public interface Tb00008Dao {

	     @Select("SELECT screen_id FROM tb00008 where design_type_id = '画面項目記述書' and section = 1")
	     @Results({
	             @Result(property = "screenId", column = "screen_id")
	     })
	     List<Tb00008> getScreenIdList();
	     
	     @Select("SELECT "
	     		+ "design_type_id,"
	     		+ "screen_id,"
	     		+ "section,"
	     		+ "screen_item_name,"
	     		+ "screen_item_physics_name,"
	     		+ "type_cd,"
	     		+ "attribute_cd "
	     		+ "FROM tb00008 "
	     		+ "WHERE "
	     		+ "design_type_id = '画面項目記述書'"
	     		+ "AND screen_id = #{screenId}"
	     		+ "OR screen_item_physics_name LIKE #{filterValue}")
	     @Results({
	             @Result(property = "designTypeId", column = "design_type_id"),
	             @Result(property = "screenId", column = "screen_id"),
	             @Result(property = "section", column = "section"),
	             @Result(property = "screenItemName", column = "screen_item_name"),
	             @Result(property = "screenItemPhysicsName", column = "screen_item_physics_name"),
	             @Result(property = "typeCd", column = "type_cd"),
	             @Result(property = "attributeCd", column = "attribute_cd")
	     })
	     List<Tb00008> getDesignScreenDtoList(@Param("screenId") String screenId, @Param("filterValue") String filterValue);
	     
	     @Select("SELECT "
		     		+ "design_type_id,"
		     		+ "screen_id,"
		     		+ "section,"
		     		+ "screen_item_name,"
		     		+ "screen_item_physics_name,"
		     		+ "type_cd,"
		     		+ "attribute_cd "
		     		+ "FROM tb00008 "
		     		+ "WHERE "
		     		+ "screen_id = #{screenId}")
		     @Results({
		             @Result(property = "designTypeId", column = "design_type_id"),
		             @Result(property = "screenId", column = "screen_id"),
		             @Result(property = "section", column = "section"),
		             @Result(property = "screenItemName", column = "screen_item_name"),
		             @Result(property = "screenItemPhysicsName", column = "screen_item_physics_name"),
		             @Result(property = "typeCd", column = "type_cd"),
		             @Result(property = "attributeCd", column = "attribute_cd")
		     })
		     List<Tb00008> getDesignScreenDtoListTemporary(@Param("screenId") String screenId);
	     
}